package io.renren.modules.communityService.controller;

import io.renren.common.utils.R;
import io.renren.modules.communityService.dto.SysUserLoginDTO;
import io.renren.modules.communityService.service.SysUserService;
import io.renren.modules.communityService.vo.SysUserVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 系统用户
 *
 * @author chenweilong
 * @email 1433471850@qq.com
 * @date 2021-03-20 17:12:27
 */
@RestController
@RequestMapping("sys/user")
@Api(value = "登录接口",tags = "登录接口")
public class LoginController {
    @Autowired
    private SysUserService sysUserService;

    /**
     * 列表
     */
    @PostMapping("/login")
    @ApiOperation(value = "根据账号密码登录",notes = "根据账号密码登录")
    public R login(@RequestBody SysUserLoginDTO sys){
        SysUserVO sysUser = sysUserService.login(sys);
        return R.data(sysUser);
    }



}
